__author__ = 'Robin'
#coding:utf-8
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response, HttpResponseRedirect

def fws_response(template,request, context={}):
    context['author']='RobinWang'
    return render_to_response(template, context_instance=RequestContext(request,context))



def fws_redirect_response(template,request, context={}):
    context['author']='RobinWang'
    return HttpResponseRedirect(template, RequestContext(request,context))


def fws_ajax_response(data,mimetype="application/json"):
    if mimetype:
        return HttpResponse(data,mimetype)
    return HttpResponse(data)